using System;
using System.Collections;
using BitMango;
using BitMango.Diagnostics;

public class InterstitialTransition : Transition
{
	public override string Name
	{
		get
		{
			return "Interstitial";
		}
	}

	public void SetCond(string sceneName_, bool isEnter_)
	{
		this.sceneName = sceneName_;
		this.isEnter = isEnter_;
		this.needLock = false;
	}

	public override IEnumerator CoTransitionIn(float duration)
	{
		yield return null;
		yield break;
	}

	public override IEnumerator CoTransitionOut(float duration)
	{
		Debugger.Log("InterstitialTransition.CoTransitionOut");
		Debugger.Assert(false == string.IsNullOrEmpty(this.sceneName));
		Debugger.Assert(Context.AdManager.IsPossibleToShowInterstitial(this.sceneName, this.isEnter));
		Context.AdManager.ShowInterstitial(this.sceneName, this.isEnter, delegate(bool success)
		{
			this.sceneName = null;
		});
		yield return null;
		yield break;
	}

	private string sceneName;

	private bool isEnter;
}
